package com.knight.study.patterns.tujie.facade;

import java.io.IOException;
import java.io.Writer;

/**
 * @Author knight
 * @Date 2024/9/11 17:25
 */

public class HtmlWriter {
    private Writer writer;

    public HtmlWriter(Writer writer) {
        this.writer = writer;
    }

    public void titile(String title) throws IOException {
        writer.write("HtmlWriter titile:" + title);
    }

    public void paragraph(String msg) throws IOException {
        writer.write("HtmlWriter paragraph:" + msg);
    }

    public void link(String href, String caption) throws IOException {
        paragraph("HtmlWriter link href:" + href + ",caption:" + caption);
    }
    public void mailto(String mailaddr, String useraname) throws IOException {
        link("HtmlWriter mailto:" + mailaddr, useraname);
    }
    public void close() throws IOException {
        writer.close();
    }
}
